ACTOR BrutalMana : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 200
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 200
   Inventory.Icon "BMANA0"
}

ACTOR BrutalGreenMana : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 200
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 200
   Inventory.Icon "GRMANA"
}

ACTOR BrutalBlueMana : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 200
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 200
   Inventory.Icon "BLMANA"
}

Actor PowerChargeFire : Ammo
{
inventory.maxamount 200
Inventory.Icon "FRPCA0"
}

Actor CastFlame: Inventory
{
inventory.maxamount 100
}

Actor QuickFireSpellSelected: Inventory
{
inventory.maxamount 1
}

ACTOR Piromancy : BrutalWeapon
{
	Height 20
	Weapon.SelectionOrder 9550
	Weapon.AmmoUse 0
	Weapon.AmmoGive 50
	Weapon.AmmoType "BrutalBlueMana"
	Weapon.AmmoType2 "PowerChargeFire"
    Inventory.PickupSound "FLAMECS"
	scale 0.5
    +WEAPON.NOAUTOAIM
	+WEAPON.NOALERT
	+WEAPON.CHEATNOTWEAPON
	+Inventory.UNDROPPABLE
	Inventory.PickupMessage "You got the Arcane Power of Firecasting! (Slot 5)"
	Inventory.ForbiddenTo BDoomer, Paladin, Corvus

	States
	{
	Steady:
	TNT1 A 1
	Goto Ready
	
	Ready3:
	Ready:
		// This is placed here for now, should be moved if there is a replaying
		// idle animation for weapons
	ReadyLoop:
	    TNT1 A 0
        TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 A 0 A_JumpIfInventory("Unloading",1,"Unload") //Unloading for select quick spell
		"####" A 0 A_JumpIfInventory("Quickspell",1,"Quickspell")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewallXS")
		TNT1 A 0 A_TakeInventory("PowerChargeFire", 200)
		TNT1 A 0 A_TakeInventory("CastFlame", 1)
		PYRO A 1 A_WeaponReady
		TNT1 A 0 A_GiveInventory("BrutalBlueMana", 2)
		PYRO A 1 A_WeaponReady
		TNT1 A 0 A_GiveInventory("BrutalBlueMana", 1)
		TNT1 A 0 A_StopSound(CHAN_WEAPON)
		TNT1 A 0 A_JumpIfInventory("KraterOfMight",1,1)
		Goto Ready
		TNT1 A 0 A_GiveInventory("BrutalBlueMana", 200) //instant recovery with chalice of mana!
		Goto Ready
	//DryFire:
	//    FLMG A 10 A_PlaySound("weapons/empty")
	//	Goto Ready+6
	
	Unload: 
		TNT1 A 0 
		TNT1 A 0 A_TakeInventory("Unloading",1)
		FQSS AB 1 
		FQSS CDEEFFF 1 Bright
		FQSS GH 2
		TNT1 A 0 A_Log("Fireball selected as Quick Spell!")
		TNT1 A 0 A_TakeInventory("QuickFrostSpellSelected",1)
		TNT1 A 0 A_TakeInventory("QuickLightningSpellSelected",1)
		TNT1 A 0 A_GiveInventory("QuickFireSpellSelected",1)
	goto Ready
	
	SpellFlash:
	TNT1 A 0
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAA 1
	stop
	
	Deselect:
	    TNT1 A 0 A_StopSound(CHAN_WEAPON)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_TakeInventory("FistsSelected", 1)
		TNT1 AAAAAAAAAAAAAAAAAAAAAAA 0 A_Lower
		CONE A 1 A_Lower
		Loop
		
	Select:
		TNT1 A 0 A_Takeinventory("HasBarrel",1)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
	    TNT1 A 0 A_PlaySound("Pyromancy/Draw")
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAA 0 A_Raise
		PYRO A 1 A_Raise
		wait
    Spawn:
        MFCR AABBCCBB 2 BRIGHT A_SpawnItem("RedFlareSmall",0,30)
		Loop
	AltFire:
		//TNT1 A 0 A_JumpIfInventory("BrutalBlueMana", 10, "ready")
		//TNT1 A 0 A_JumpIfInventory("CastFlame", 1, "Flamethrower")
		FH2T ABCDEF 1 BRIGHT 
		FHFA CDE 1 BRIGHT
		//TNT1 A 0 A_JumpIfInventory("Gas", 4, "Flamethrower")
	//	TNT1 A 0 A_StopSound(CHAN_WEAPON)
		//Goto DryFire
		
	Flamethrower:
		//TNT1 A 0 A_JumpIfInventory("BrutalBlueMana", 0, "Ready")
		//TNT1 A 0 A_GiveInventory("CastFlame", 1)
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",10,2)
        Goto Depletion
        TNT1 AAA 0
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",10)
		TNT1 A 0 A_FireCustomMissile("LostSoulOnHandFireSpawner",25,0,-10,0)
        TNT1 A 0 BRIGHT A_FireCustomMissile("MageFlameMissile", 0, 1, -15, 0)
		TNT1 A 0 A_PlaySound("Sorcerer/SpellCast", CHAN_VOICE) 		
		TNT1 A 0 A_PlaySound("FLAMER", CHAN_WEAPON,1,1) 		//		TNT1 A 0 A_PlaySound("FLAMER", CHAN_WEAPON, 1, 1)
		//TNT1 A 0 A_TakeInventory("Gas", 4)
		FHFA FGH 1 BRIGHT 
		FHFA I 1 BRIGHT A_SetAngle(random(1, -1) + angle)
		FHFA J 1 BRIGHT A_SetPitch(random(1, -1) + pitch)
		FHFA K 1 BRIGHT A_SetAngle(random(1, -1) + angle)
		TNT1 A 0 A_ReFire("Flamethrower2")
		//TNT1 A 0 A_PlaySound("FLAMSTOP", CHAN_WEAPON)
		FHFA R 2 BRIGHT 
		Goto Depletion
		//Goto Ready+6
		
	Flamethrower2:
		//TNT1 A 0 A_JumpIfInventory("BrutalBlueMana", 0, "Ready")
		//TNT1 A 0 A_GiveInventory("CastFlame", 1)
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",10,2)
        Goto Depletion
        TNT1 AAA 0
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",10)
		TNT1 A 0 A_FireCustomMissile("LostSoulOnHandFireSpawner",-25,0,20,0)
        TNT1 A 0 BRIGHT A_FireCustomMissile("MageFlameMissile", 0, 1, 15, 0)
		TNT1 A 0 A_PlaySound("FLAMER", CHAN_WEAPON,1,1) 		//		TNT1 A 0 A_PlaySound("FLAMER", CHAN_WEAPON, 1, 1)
		//TNT1 A 0 A_TakeInventory("Gas", 4)
		FHFA KL 1 BRIGHT 
		FHFA M 1 BRIGHT A_FireCustomMissile("MageFlameMissile", 0, 1, 15, 0)
		FHFA N 1 BRIGHT A_SetAngle(random(1, -1) + angle)
		FHFA O 1 BRIGHT A_SetPitch(random(1, -1) + pitch)
		FHFA P 1 BRIGHT A_SetAngle(random(1, -1) + angle)
		TNT1 A 0 A_ReFire("Flamethrower2")
		//TNT1 A 0 A_PlaySound("FLAMSTOP", CHAN_WEAPON)
		FHFA R 2 BRIGHT 
		Goto Depletion
		//Goto Ready+6
	
  Fire:
  		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana", 5, 2)
		Goto Ready
		FHSA AB 1
        FHST ABCDEFGHIJKL 1 BRIGHT
       // TNT1 A 0 A_JumpIfInventory("Gas", 15, "Fireball")
	//	TNT1 A 0 A_StopSound(CHAN_WEAPON)
		//Goto DryFire
		TNT1 A 0 A_Refire("Hold")
		Goto CastSmallFireball
		
	Hold:
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",10,2)
		goto Depletion
		TNT1 A 0 A_PlaySound("Pyromancy/ChargeStart", 6)
		TNT1 A 0 A_PlaySound("Pyromancy/ChargeLoop1", 1, 1, 1)
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 100, "Hold5")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 75, "Hold4")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 50, "Hold3")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 25, "Hold2")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewallXS")
		
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1, "CastFireArrow")
		FHLL A 2 BRIGHT 
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHLL B 2 BRIGHT 
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHLL C 2 BRIGHT 
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		TNT1 A 0 A_ReFire("Hold0") 	//to make animation smooth I divide 6 tics animation on two diferent states in loop
		Goto Discharge				//but if player have problems with timing, he just release mouse button and fire. NOW!
	
	Hold0: 							//state for code trick to show smoth animation of LMB hold and make weapon more responsive
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",1,2)
		goto discharge
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 100, "Hold5")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 75, "Hold4")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 50, "Hold3")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 25, "Hold2")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1, "CastFireArrow")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewallXS")
		
		TNT1 A 0 A_JumpIfInventory("Reloading",1, "StartWarp")
		FHLL D 2 BRIGHT 
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHLL E 2 BRIGHT 
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHLL F 2 BRIGHT 
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		TNT1 A 0 A_ReFire		//here we go to first Hold state and first frame of our shiny hold animation... 
		Goto Discharge	
	
	
	Hold2:
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",1,2)
		goto discharge
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 50, "Hold3")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1, "CastFireBolt")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewallXS")
		
		TNT1 A 0 A_PlaySound("BDFirePlace", CHAN_WEAPON, 1, 1)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHLL A 2 BRIGHT A_FireCustomMissile("RedFlareSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHLL B 2 BRIGHT A_FireCustomMissile("RedFlareSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHLL C 2 BRIGHT A_FireCustomMissile("RedFlareSpawn",35,0,0,3)
		TNT1 A 0 A_JumpIfInventory("Reloading",1, "StartWarp")
		TNT1 A 0 A_ReFire("Hold22")
		Goto Discharge
		
	Hold22: //same shit again and again for other hold states
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",1,2)
		goto discharge
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 50, "Hold3")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1, "CastFireBolt")
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewallSmall")
		
		TNT1 A 0 A_PlaySound("BDFirePlace", CHAN_WEAPON, 1, 1)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHLL D 2 BRIGHT A_FireCustomMissile("RedFlareSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHLL E 2 BRIGHT A_FireCustomMissile("RedFlareSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHLL F 2 BRIGHT A_FireCustomMissile("RedFlareSpawn",35,0,0,3)
		TNT1 A 0 A_JumpIfInventory("Reloading",1, "StartWarp")
		TNT1 A 0 A_ReFire
		Goto Discharge
		
	Hold3:
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",1,2)
		goto Depletion
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 75, "Hold4")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "CastFireSpear") //CastPurgatory
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewallSmall")
				
		TNT1 A 0 A_PlaySound("Pyromancy/ChargeLoop2", 1, 1, 1)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHL2 A 2 BRIGHT A_FireCustomMissile("RedFlareSmallSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHL2 B 2 BRIGHT A_FireCustomMissile("RedFlareSmallSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHL2 C 2 BRIGHT A_FireCustomMissile("RedFlareSmallSpawn",35,0,0,3)
		TNT1 A 0 A_JumpIfInventory("Reloading",1, "StartWarp2")
		TNT1 A 0 A_ReFire("Hold32") 
		Goto Discharge
		
	Hold32: 
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",1,2)
		goto Depletion
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 75, "Hold4")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "CastFireSpear") //CastPurgatory
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewallSmall")
		
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHL2 D 2 BRIGHT A_FireCustomMissile("RedFlareSmallSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHL2 E 2 BRIGHT A_FireCustomMissile("RedFlareSmallSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHL2 F 2 BRIGHT A_FireCustomMissile("RedFlareSmallSpawn",35,0,0,3)
		TNT1 A 0 A_JumpIfInventory("Reloading",1, "StartWarp2")
		TNT1 A 0 A_ReFire 
		Goto Discharge
		
	Hold4:
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",1,2)
		goto Depletion
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewall")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 100, "HoldEnd")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "CastOnager")
	//	TNT1 A 0 A_PlaySound("BDFirePlace2", CHAN_WEAPON, 3, 1)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHL2 A 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHL2 B 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHL2 C 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		TNT1 A 0 A_JumpIfInventory("Reloading",1, "StartWarp3")
		TNT1 A 0 A_ReFire("Hold42")
		Goto Discharge
	
	Hold42:
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",1,2)
		goto Depletion
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewall")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 100, "HoldEnd")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "CastOnager")
	//	TNT1 A 0 A_PlaySound("BDFirePlace2", CHAN_WEAPON, 3, 1)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHL2 D 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",2)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",2)
		FHL2 E 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		FHL2 F 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_JumpIfInventory("Reloading",1, "StartWarp3")
		TNT1 A 0 A_ReFire
		Goto Discharge
	
	HoldEnd:
		TNT1 A 0 A_PlaySound("Pyromancy/ChargeEnd", 6)
	Hold5:
		TNT1 A 0 A_JumpIfInventory("BrutalBlueMana",1,2)
		goto Depletion
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"InitializeFirewall")
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
        TNT1 A 0 A_FireCustomMissile("LostSoulOnHandFireSpawner",35,0,0,3)
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "CastInfernalOnager")
		FHL2 A 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		TNT1 A 0 A_SetPitch(random(1, -1) + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		FHL2 B 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		TNT1 A 0 A_SetAngle(frandom(0.6, -0.6) + angle)
		FHL2 C 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
        TNT1 A 0 A_FireCustomMissile("LostSoulOnHandFireSpawner",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		TNT1 A 0 A_SetPitch(random(1, -1) + pitch)
		FHL2 D 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		TNT1 A 0 A_SetAngle(frandom(0.6, -0.6) + angle)		
		FHL2 E 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",1)
		TNT1 A 0 A_GiveInventory("PowerChargeFire",1)
		TNT1 A 0 A_SetPitch(random(1, -1) + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
        TNT1 A 0 A_FireCustomMissile("LostSoulOnHandFireSpawner",35,0,0,3)
		FHL2 F 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
		TNT1 A 0 A_SetAngle(frandom(0.6, -0.6) + angle)
		TNT1 A 0 A_JumpIfInventory("Reloading",1, "StartWarp4")
		TNT1 A 0 A_ReFire("Hold5")
		Goto Discharge
		
	Discharge:
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 100, "CastPurgatory")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 75, "CastDeadlyFireball")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 50, "CastBigFireball")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 25, "CastFireball")
		TNT1 A 0 A_JumpIfInventory("PowerChargeFire", 1, "CastSmallFireball")
		Goto Ready
		
	Depletion:
		TNT1 A 0 A_TakeInventory("PowerChargeFire",200)
		DISF ABCDEE 2 
		TNT1 A 0 A_GiveInventory("BrutalBlueMana",1) //to absolutelly prevent fucking autoswitch weapon with no ammo...!
		goto Ready
		
	
	StartWarp:
	TNT1 A 0 A_JumpIfInventory("IceCounter", 1, "IcePrint")
	TNT1 A 0 A_JumpIfInventory("AllCounter", 7, "AllPrint")
	TNT1 A 0 A_JumpIfInventory("FireCounter", 4, "FirePrint")
	TNT1 A 0 A_GiveInventory("AllCounter",1)
	TNT1 A 0 A_GiveInventory("FireCounter",1)
	TNT1 A 0 A_PlaySound("BDFirePlace", CHAN_WEAPON, 1, 1)
	FHLL ABCDEF 2 BRIGHT A_FireCustomMissile("RedFlareSpawn",35,0,0,3)
	StartWarp2:
	FHLL ABCDEF 2 BRIGHT A_FireCustomMissile("RedFlareSmallSpawn",35,0,0,3)
	StartWarp3:
	TNT1 A 0 A_PlaySound("Pyromancy/ChargeLoop2", 1, 1, 1)
	FHL2 ABCDEF 2 BRIGHT A_FireCustomMissile("RedFlareMediumSpawn",35,0,0,3)
	StartWarp4:
	FHL2 ABCDEF 2 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",35,0,0,3)
		
		SCBS D 2 BRIGHT 
		TNT1 A 0 A_SpawnItemEx("FireWarperA", 0, 0, 0, 0, 0, 0, 0, SXF_SETMASTER|SXF_NOCHECKPOSITION)
		TNT1 A 0 A_GiveInventory("FireImmunity",1)
		
		SCBA ABCDE 2  
		TNT1 A 0 A_Takeinventory("PowerChargeStorm",200) 
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("BrutalBlueMana",200)
		SCBA F 5
		
		goto Ready
		
	IcePrint:
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Print("You can't spell fire warpers with ice warpers!", -30)
		Goto Ready
	AllPrint:
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Print("You can't spell more than 7 warpers!", -30)
		Goto Ready
	FirePrint:
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Print("You can't spell more than 4 fire warpers!", -30)
		Goto Ready
//===============
//FIREBALL CASTS
//===============
		
	CastSmallFireball:	
		TNT1 A 0 A_AlertMonsters 	
		TNT1 A 0 A_PlaySound("Pyromancy/FireballCast")
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",10)
        FRBA EFGH 1 BRIGHT 
		TNT1 A 0 A_SetPitch(-3.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		TNT1 A 0 A_PlaySound("Sorcerer/MediumExert", CHAN_VOICE) 		
		FRBA I 2 BRIGHT A_FireCustomMissile("MageSmallFireBall", 0, 1, 0, 0)
		FRBA J 2 BRIGHT
		FRBA KLM 2 A_SetPitch(+1.0 + pitch)
		CONE A 4
		Goto Ready+2
		
	CastFireball:
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_PlaySound("Pyromancy/FireballCast")
        FRBA EFGH 1 BRIGHT 
		TNT1 A 0 A_SetPitch(-6.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		TNT1 A 0 A_PlaySound("Sorcerer/SpellCast", CHAN_VOICE) 		
		FRBA I 2 BRIGHT A_FireCustomMissile("MageFireBall", 0, 1, 0, -10)
		FRBA J 2 BRIGHT
		FRBA KLM 2 A_SetPitch(+2.0 + pitch)
		CONE A 8
		Goto Ready+2

	CastBigFireball:
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_PlaySound("Pyromancy/FireballCast")
        FRBA EFGH 1 BRIGHT 
		TNT1 A 0 A_SetPitch(-6.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		FRBA I 2 BRIGHT 
		TNT1 A 0 A_PlaySound("Sorcerer/SpellCast", CHAN_VOICE) 		
		FRBA J 2 BRIGHT A_FireCustomMissile("MageBigFireBall", 0, 1, 0, 0)
		FRBA KLM 2 A_SetPitch(+2.0 + pitch)
		CONE A 8
		Goto Ready+2
		
	CastDeadlyFireball:	
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_PlaySound("FIRECS")
		FRBA EFGH 1 BRIGHT 
		TNT1 A 0 A_TakeInventory("HomingFireballDied", 1)
		TNT1 A 0 A_SetPitch(-6.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
		FRBA I 2 BRIGHT 
		TNT1 A 0 A_PlaySound("Sorcerer/SpellCastLarge", CHAN_VOICE) 		
		FRBA J 2 BRIGHT A_FireCustomMissile("MageHomingFireBall", 0, 1, 0, 0) //A_FireCustomMissile("FireBallSpawnActor", 0, 1, 0, 0)
		
		//	Targeting:
		//		CONE B 1
		//		CONE B 0 A_FireBullets(0,0,1,0,"HomingSpecPuff",0)
		//		//TNT1 A 0 A_JumpIfInventory("TargetingCharge", 30, "Ready")
		//		//TNT1 A 0 A_GiveInventory("TargetingCharge",1)
		//		//CONE B 0 A_JumpIfInventory("HomingFireballDied", 1, "Ready")
		//		CONE B 0 A_JumpIf(ACS_ExecuteWithResult(502,800,0,0)==0,"Targeting")
		//		CONE B 0 A_TakeInventory("FireballIsDead",1)
				goto ready
	
	CastPurgatory:	
        //CONE ABCD 2
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_PlaySound("FIRECS")
		NULL A 0 A_JumpIf (pitch > 45, "LowChecker1")//it means if you looks too low than you cast firewall, if no - than purgatory.
	InitializePurgatory:
		CONG EFGHI 2 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
		TNT1 A 0 A_FireCustomMissile ("SuperHammerFX", 0, 1, 0, 0) 
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana", 200)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        CONE BA 3 A_SetPitch(+2.0 + pitch)
		CONE AAAAA 3 A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
		Goto Ready

	LowChecker1:
	    TNT1 A 1
	    NULL A 0 A_JumpIf (pitch > 90, "InitializePurgatory")
	
	TossGrenade: 
		InitializeFirewallXS:
		CONG EFGHI 2 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
		TNT1 A 0 A_PlaySound("Sorcerer/SpellCastLarge", CHAN_VOICE) 		
		TNT1 A 0 A_FireCustomMissile ("FirewallXS", 0, 1, 0, 0) //("SuperHammerFX", 0, 1, 0, 0)
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana", 200)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        CONE BA 3 A_SetPitch(+2.0 + pitch)
		CONE AAAAA 3 A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto Ready

	InitializeFirewallSmall:
		CONG EFGHI 2 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
		TNT1 A 0 A_PlaySound("Sorcerer/SpellCastLarge", CHAN_VOICE) 		
		TNT1 A 0 A_FireCustomMissile ("FirewallSmall", 0, 1, 0, 0) //("SuperHammerFX", 0, 1, 0, 0)
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana", 200)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        CONE BA 3 A_SetPitch(+2.0 + pitch)
		CONE AAAAA 3 A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto Ready
		
	InitializeFirewall:
		CONG EFGHI 2 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
		TNT1 A 0 A_PlaySound("Sorcerer/SpellCastLarge", CHAN_VOICE) 		
		TNT1 A 0 A_FireCustomMissile ("Firewall", 0, 1, 0, 0) //("SuperHammerFX", 0, 1, 0, 0)
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		TNT1 A 0 A_TakeInventory("BrutalBlueMana", 200)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        CONE BA 3 A_SetPitch(+2.0 + pitch)
		CONE AAAAA 3 A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-40,40),0,0,3)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto Ready

   /* DoKick:
	    TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		NULL A 0 A_JumpIf (pitch > 32, "LowKickChecker1")
	InitializeNormalKick:
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		STMP ABCDEF 1
		//TNT1 A 0 A_Custompunch(4,0,1,"KickPuff")
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        STMP G 4
		KICK A 0 A_Takeinventory("Kicking",1)
		STMP HIJK 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 SetPlayerProperty(0,0,0)
		NULL A 0 A_TakeInventory("KickHasHit",1)
		Goto Ready+6

		
		*/

//===============
//FIREARROW CASTS
//===============
	
	
	CastFireArrow:	
        //CONE ABCD 2
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",25)
		TNT1 A 0 A_PlaySound("IGNITE")
		CONG EF 3 BRIGHT
		TNT1 A 0 A_FireCustomMissile("FireArrow", 0, 1, 0, -11)
		CONG GHI 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-20,30),0,0,-10)
		//CONE F 2 BRIGHT A_FireCustomMissile("MageSmallFireBall", random(-2,2), 1, 0, 0)
		//CONE F 2 BRIGHT A_FireCustomMissile("MageSmallFireBall", random(-2,2), 1, 0, 0)
		//CONE F 2 BRIGHT A_FireCustomMissile("MageSmallFireBall", random(-2,2), 1, 0, 0)
		//CONE F 2 BRIGHT A_FireCustomMissile("MageSmallFireBall", random(-2,2), 1, 0, 0)
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		//TNT1 A 0 A_TakeInventory("Gas", 25)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        TNT1 A 0 A_SetPitch(+2.0 + pitch)
		CONE A 10
		Goto Ready+2
		
	CastFireBolt:
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_PlaySound("IGNITE")
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",50)
		CONG EF 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-30,30),0,0,-12)
		TNT1 A 0 A_FireCustomMissile("FireBolt", 0, 1, 0, -11)
		CONG GHI 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-30,30),0,0,-12)
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		//TNT1 A 0 A_TakeInventory("Gas", 25)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        CONE B 2 BRIGHT 
        CONE BA 2 A_SetPitch(+2.0 + pitch)
		CONE A 12
		Goto Ready+2
	
	CastFireSpear:
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_PlaySound("IGNITE")
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",75)
		CONG EF 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-30,30),0,0,-12)
		TNT1 A 0 A_FireCustomMissile("FireSpear", 0, 1, 0, -11)
		CONG GHI 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-30,30),0,0,-12)
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		//TNT1 A 0 A_TakeInventory("Gas", 25)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        CONE B 2 BRIGHT 
        CONE BA 2 A_SetPitch(+2.0 + pitch)
		CONE A 15
		Goto Ready+2
	
	CastOnager:
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_PlaySound("IGNITE")
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",75)
		CONG EF 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-30,30),0,0,-12)
		TNT1 A 0 A_FireCustomMissile("Onager", 0, 1, 0, -11)
		//TNT1 A 0 A_FireCustomMissile("Onager", 0, 1, 0, -11)
		CONG GHI 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-30,30),0,0,-12)
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		//TNT1 A 0 A_TakeInventory("Gas", 25)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        CONE B 2 BRIGHT 
        CONE BA 2 A_SetPitch(+2.0 + pitch)
		CONE A 18
		Goto Ready+2
		
	CastInfernalOnager:	
		TNT1 A 0 A_AlertMonsters 
		TNT1 A 0 A_TakeInventory("BrutalBlueMana",100)
        //CONE ABCD 2
		TNT1 A 0 A_PlaySound("FIRECS")
		CONG EF 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-20,20),0,0,-10)
		TNT1 A 0 A_FireCustomMissile("InfernalOnager", 0, 1, 0, -11)
		//TNT1 A 0 A_FireCustomMissile("BlackSunBall", 0, 1, 0, -11)
		CONG GHI 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-30,30),0,0,-12)
		
		TNT1 A 0 A_SetPitch(-4.0 + pitch)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssDouble", 0, 0, 0, 0)
        CONE B 3 BRIGHT A_FireCustomMissile("LostSoulOnHandFireSpawner",random (-30,30),0,0,-15)
        CONE BA 2 BRIGHT A_SetPitch(+2.0 + pitch) 
		CONE A 20
		Goto Ready+2
/*
    Taunt:
        MLNG ABCD 2 BRIGHT
	BlinkageHold:
		MLNG E 1 A_FireCustomMissile("BlinkTargetMissile")
		MLNG FG 2 BRIGHT A_ZoomFactor(0.80, ZOOM_INSTANT)
		MLNG HI 2 BRIGHT A_ZoomFactor(1.00)
		//MLNG E 1 A_FireBullets(0,0,1,0,"BlinkTargetPuff",FBF_NORANDOMPUFFZ,512)
		TNT1 A 0 A_ReFire("BlinkageHold")
		TNT1 A 0 A_Takeinventory("Taunting",1)
		TNT1 A 0 A_Teleport("Teleportium","BlinkTarget",None,TF_TELEFRAG,0,0)
		Goto Ready
		
	Teleportium:
		MLNG I 4 BRIGHT
		TNT1 A 0 A_StopSound(7)
		TNT1 A 0 A_PlaySound("DSBOSPIT", 2)
//		PUND CCBA 1
		Goto Ready
*/

	Salute:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		TNT1 A 0 A_ALertMonsters
		SALU ABCDEDCDEDCDEDCBA 4
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready
		
	}
}